#include <stdio.h>
#include<unistd.h>
#include <stdlib.h>
#include <sys/wait.h>
int main(){

  if(fork() == 0){
     printf("command begin...\n");
     //execl("/usr/bin/ls","ls","-a","-l","-i",NULL);
     
     //char* argv[] = {"ls","-a","-l","-i",NULL};
     //execv("/usr/bin/ls", argv);
     
     //execlp("ls","ls","-a","-l","-d",NULL);
     
     //char* argv[] = {"ls","-a","-l","-i",NULL};
     //execvp("ls",argv);
     
     //execl("./myexe","myexe",NULL);
     
     char* env[] = {
       "MYENY = hahahahahahaha", 
       "MYENY1 = hahahahahahaha", 
       "MYENY2 = hahahahahahaha", 
       "MYENY3 = hahahahahahaha",
       NULL
     };
     //execle("./myexe","myexe",NULL,env);
     
     char* argv[] = {"myexe", NULL};
     execve("./myexe",argv,env);
     printf("command end..\n");
     exit(1);
  }
  waitpid(-1,NULL,0);
  printf("wait child success!\n");
  return 0;
}
